package com.itheima.ExceptionHandler;

import com.itheima.domain.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@Slf4j
@RestControllerAdvice
public class GlobalExceptionHandler {
    @ExceptionHandler
    public Result error(Exception e){
        log.error("异常是",e);
        return Result.error("忙，稍等");
    }
}
